//
// Created by wkm on 2023-12-05.
//

#ifndef MYSYSTEMCLEARNING_GRAY_CTR_H
#define MYSYSTEMCLEARNING_GRAY_CTR_H

#include "systemc.h"

enum gray_states {
    s0 = 0x0, s1 = 0x1, s2 = 0x3, s3 = 2, s4 = 0x6, s5 = 0x7, s6 = 0x5, s7 = 0x4
};

SC_MODULE(gray_ctr) {
    sc_in<bool> clk, reset, up_down, hold;
    sc_out<gray_states> gray_count;

    void prc_counter();

    SC_CTOR(gray_ctr) {
        SC_METHOD(prc_counter);
        sensitive_neg << clk << reset;
    }
};

#endif //MYSYSTEMCLEARNING_GRAY_CTR_H
